<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
    <meta content="webkit" name="renderer">
    <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
    <meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0"
          name="viewport">
    <link rel="stylesheet" href="/asset/layui/css/layui.css" media="all">
</head>
<body>

<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card-body">
                <div class="layui-form" lay-filter="form">
                    <div class="layui-form-item">
                        <label class="layui-form-label">权限名称<span style="color:red">*</span></label>
                        <div class="layui-input-block">
                            <input type="text" name="name" class="layui-input" lay-verify="required" autocomplete="off">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">权限编码<span style="color:red">*</span></label>
                        <div class="layui-input-block">
                            <input type="text" name="code" class="layui-input" lay-verify="required" autocomplete="off">
                        </div>
                    </div>
                    <div class="layui-form-item layui-hide">
                        <input type="button" lay-submit lay-filter="add" id="add">
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script src="/asset/layui/layui.js"></script>
<script src="/my/fast.js"></script>
<script>
    // 接口地址
    let saveOrUpdate = UPMS_ADDRESS + '/sysPerm/addRoot'

    layui.use(() => {
        let $ = layui.$;
        let form = layui.form;

        // 监听表单提交--add
        form.on('submit(add)', obj => {
            layuiSubmit(saveOrUpdate, obj.field, null, () => {
                parent.location.reload();
            });
        });

    });
</script>
</body>
</html>
